package vue;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class PanelChoixMenu extends JPanel {

	/*JButton btnConsultGameWin;
	JButton btnNewGame;
	JButton btnQuit*/
	JPanel panelFleche;
	JPanel panelInstructions;
	//JPanel panelBoutons;
	
	private JLabel[][] fleches;
	private int positionFleche = 5;
	
	public PanelChoixMenu()
	{
		super();
		this.setLayout(new BorderLayout());
		//this.setBorder(BorderFactory.createLineBorder (Color.black, 1));
		//this.setPreferredSize(new Dimension(40,650));
		
		/*btnConsultGameWin = new JButton("Consulter");
		btnNewGame = new JButton("Nouvelle");
		btnQuit = new JButton("Quitter");*/
		
		panelFleche = new JPanel();
		panelFleche.setLayout(new GridLayout(6,1));
		panelFleche.setPreferredSize(new Dimension(40,650));

		fleches = new JLabel[6][1];
		
		for (int i = 0; i<5; i++)
		{
			for (int j = 0; j<1; j++)
			{
				fleches[i][j] = new JLabel(" ");
				fleches[i][j].setBorder(BorderFactory.createLineBorder (Color.black, 1));
				panelFleche.add(fleches[i][j]);
				
			}
		}
		fleches[5][0] = new JLabel(" -->");
		fleches[5][0].setBorder(BorderFactory.createLineBorder (Color.black, 1));
		panelFleche.add(fleches[5][0]);
		
		
		panelInstructions = new JPanel();
		panelInstructions.setLayout(new GridLayout(3,1));
		panelInstructions.setPreferredSize(new Dimension(40,80));

		//panelInstructions.setBorder(BorderFactory.createLineBorder (Color.black, 1));
		
		/*panelBoutons = new JPanel();
		panelBoutons.setLayout(new GridLayout(3,1));
		panelBoutons.setPreferredSize(new Dimension(110,650));
		panelBoutons.add(btnConsultGameWin);
		panelBoutons.add(btnNewGame);
		panelBoutons.add(btnQuit);
		panelBoutons.setBorder(BorderFactory.createLineBorder (Color.black, 1));*/

		this.add(panelFleche, BorderLayout.EAST);
		//this.add(panelBoutons,BorderLayout.CENTER);
		this.add(panelInstructions, BorderLayout.SOUTH);

		//this.add(btnNewGame,BorderLayout.CENTER);
	}
	
	public void monterFleche()
	{
		if (positionFleche != 0)
		{
			fleches[positionFleche][0].setText("");
			fleches[positionFleche - 1][0].setText(" --> ");
			positionFleche = positionFleche - 1;
		}
	}
	
	public int getPositionFleche()
	{
		return positionFleche;
	}
}
